package br.com.roteador.rota;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import br.com.roteador.endereco.Endereco;

@Entity
@Table(name="destino")
public class Destino implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -3120563227232526987L;

	@Id
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    @Column(name="id")
    private Integer id;
	
	@OneToOne(fetch = FetchType.LAZY)
	@JoinColumn(name="rota_id")
	private Rota rota;
	
	@OneToOne(fetch = FetchType.LAZY)
	@JoinColumn(name="endereco_id")
	private Endereco endereco;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Rota getRota() {
		return rota;
	}

	public void setRota(Rota rota) {
		this.rota = rota;
	}

	public Endereco getEndereco() {
		return endereco;
	}

	public void setEndereco(Endereco endereco) {
		this.endereco = endereco;
	}
	
}